const autoprefixer = require('autoprefixer');
const pxtorem = require('postcss-pxtorem');
const path = require('path');
module.exports = {
  outputDir: 'dist',
  // publicPath: process.env.NODE_ENV === 'production' ? '/vant-demo/' : './',
  publicPath: './',
  //px auto change rem
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          autoprefixer(),
          pxtorem({
            rootValue: 37.5,
            propList: ['*']
          })
        ]
      }
    }
  },
  //别名配置
  chainWebpack: (config)=>{
    config.resolve.alias
      .set('@$', path.join(__dirname,'src'))
      .set('components', path.join(__dirname,'src/components'))
      .set('common', path.join(__dirname,'src/common'))
      .set('network', path.join(__dirname,'src/network'))
      .set('assets', path.join(__dirname,'src/assets'))
      .set('views', path.join(__dirname,'src/views'))
      .set('utils', path.join(__dirname,'src/utils'))

  },
};